﻿package edu.chds.data.php {			import flash.events.*;	import flash.net.*;		public class PhpSaver extends EventDispatcher {		private var phpFile:String;		private var saveToFile:String;		private var request:URLRequest;		private var loader:URLLoader = new URLLoader();		public var vars:URLVariables = new URLVariables();		public var success:Boolean;				public function PhpSaver(){							}		public function save(php:String, saveFile:String, saveContent:String):void {			phpFile = php;			saveToFile = saveFile;			request = new URLRequest(phpFile);			vars.content = saveContent;			vars.fileName = saveToFile;			request.data = vars;			request.method = URLRequestMethod.POST;			loader.load(request);			loader.addEventListener(Event.COMPLETE, checkStatus);		}		private function checkStatus(e:Event):void {			if (loader.data == vars.content) {				success = true;
			}
			dispatchEvent(new Event(Event.COMPLETE));
		}	}}